package com.gshop.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class indexController {

	@GetMapping(value="/index")
	public  String index(Model model){
		List<Object> menuList=new ArrayList<Object>();
		Map<String , String> menu = new HashMap<String, String>();
		menu.put("name","首页");
		menu.put("url","./index.html");
		menuList.add(menu);
		menu = new HashMap<String, String>();
		menu.put("name","商品");
		menu.put("url","./goods");
		menuList.add(menu);
		model.addAttribute("menuList",menuList);
		//站内快讯
		List<Object> new_articles_list=new ArrayList<Object>();
		Map<String , String> article = new HashMap<String, String>();
		article.put("url","");
		article.put("title","今日新到货商品20件");
		new_articles_list.add(article);
		article = new HashMap<String, String>();
		article.put("url","");
		article.put("title","今日周年庆所有商品5折");
		new_articles_list.add(article);
		model.addAttribute("new_articles_list",new_articles_list);
		//--------------

		model.addAttribute("copyright","copyright-1");
		model.addAttribute("description","description-1");
		model.addAttribute("ecs_css_path","/static/css/style.css");
		model.addAttribute("feed_url","feed_url-1");
		List<Object> flashList=new ArrayList<>();
		Map<String , String> flash = new HashMap<String, String>();
		flash.put("src","/static/data/afficheimg/20160128exxdnz.jpg");
		flash.put("url","http://");
		flashList.add(flash);
		flash = new HashMap<String, String>();
		flash.put("src","/static/data/afficheimg/20160129prsrpo.png");
		flash.put("url","http://mb.ecmoban.com/kuajingtong/");
		flashList.add(flash);
		flash = new HashMap<String, String>();
		flash.put("src","/static/data/afficheimg/20160129vfrgku.jpg");
		flash.put("url","http://dsc.ecmoban.com/");
		flashList.add(flash);
		flash = new HashMap<String, String>();
		flash.put("src","/static/data/afficheimg/20160129bcmitn.jpg");
		flash.put("url","http://www.ecjia.com/");
		flashList.add(flash);
		flash = new HashMap<String, String>();
		flash.put("src","/static/data/afficheimg/20150608boezpt.png");
		flash.put("url","http://www.ectouch.cn/");
		flashList.add(flash);
		flash = new HashMap<String, String>();
		flash.put("src","/static/data/afficheimg/20160129pcigev.png");
		flash.put("url","http://www.ectouch.cn/");
		flashList.add(flash);
		model.addAttribute("flashList",flashList);
		Map<String , String> goods = new HashMap<String, String>();
		goods.put("market_price","9.99");
		goods.put("name","蓝语大码女装");
		goods.put("promote_price","6.66");
		goods.put("shop_price","7.77");
		goods.put("short_name","蓝语大码女装");
		goods.put("short_style_name","short_style_name-1");
		goods.put("thumb","//img.alicdn.com/imgextra/i1/12/TB2EQ.pDHSYBuNjSspfXXcZCpXa_!!12-0-lubanu.jpg_210x1000q90.jpg");
		goods.put("url","/goods");
		Map<String , String> goods_cat = new HashMap<String, String>();
		goods_cat.put("name","name-1");
		Map<String , String> help_cat = new HashMap<String, String>();
		help_cat.put("cat_name","cat_name-1");
		model.addAttribute("icp_number","icp_number-1");
		model.addAttribute("im","im-1");
		Map<String , String> item = new HashMap<String, String>();
		item.put("short_title","short_title-1");
		item.put("title","title-1");
		item.put("url","");
		model.addAttribute("keywords","666666666666");
		Map<String , String> lang = new HashMap<String, String>();
		lang.put("home","666666666666");
		lang.put("icp_number","666666666666");
		lang.put("process_request","666666666666");
		lang.put("promote_price","666666666666");
		model.addAttribute("licensed","666666666666");
		Map<String , String> link = new HashMap<String, String>();
		link.put("name","666666666666");
		link.put("url","");
		Map<String , String> nav = new HashMap<String, String>();
		nav.put("name","666666666666");
		nav.put("url","");
		model.addAttribute("page_title","666666666666");
		model.addAttribute("pv","666666666666");
		model.addAttribute("service_email","666666666666");
		model.addAttribute("service_phone","666666666666");
		model.addAttribute("shop_address","666666666666");
		model.addAttribute("shop_name","666666666666");
		model.addAttribute("shop_postcode","666666666666");
		model.addAttribute("stats_code","666666666666");
		model.addAttribute("goods",goods);
		model.addAttribute("goods_cat",goods_cat);
		model.addAttribute("help_cat",help_cat);
		model.addAttribute("item",item);
		model.addAttribute("lang",lang);
		model.addAttribute("link",link);
		model.addAttribute("nav",nav);
		return "index";
	}
}
